package net.cyndeline.scalarlib.rlgraph.pathfinding

import scalax.collection.GraphPredef.EdgeLikeIn

/**
 * A path in a graph.
 *
 * @param start The first vertex in the path.
 * @param stop The last vertex in the path. May be the same as start if the path contains a single vertex.
 * @param vertices Every vertex in the path, in the order they are traversed from start to stop.
 * @param edges Every edge in the path, in the order they are traversed from start to stop. Empty if the path
 *              only contains a single vertex.
 */
class Path[V, E[X] <: EdgeLikeIn[X]](val start: V, val stop: V, val vertices: Vector[V], val edges: Vector[E[V]]) {

  /**
   * Constructs a path with a single vertex.
   * @param startAndStop The only vertex in the path.
   */
  def this(startAndStop: V) = this(startAndStop, startAndStop, Vector(startAndStop), Vector())
}
